/**
 * Created by cchen on 2015/4/16.
 */

/*
 * Mobile App to share link to any App
 */

module.exports = function (app) {
    var share = require('../../controllers/mobile/shares-controller');

    //Share content with questions and activities
    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/questions/getQuestionShare/:targetApp/:userId/:questionId/:deviceId', share.shareQuestion);
    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/activities/getActivityShare/:targetApp/:userId/:activityId/:deviceId', share.shareActivity);
    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/specialTopic/getSpecialTopicShare/:targetApp/:userId/:topicId/:deviceId', share.shareSpectialTopic);
    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/app/getAppShare/:targetApp/:userId/:deviceId', share.shareApp);


    app.get('/rest/' + RESTFullServiceVersion + '/mobile/web/share/:shareId/:userId', share.getSharedFeeds);

    app.get('/rest/' + RESTFullServiceVersion + '/mobile/web/getAppUserShare/:userId', share.getAppUserShare);

    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/activities/getPartakesByActivityId/:pageNo/:activityId', share.getPartakesByActivityId);
    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/activities/getActivityMessageCode/:phone', share.getActivityMessageCode);
    app.post('/rest/' + RESTFullServiceVersion + '/mobile/shares/activities/joinInActivityByWechat', share.joinInActivityByWechat);

    app.post('/rest/' + RESTFullServiceVersion + '/mobile/shares/shareCallback/:deviceId', share.shareCallback);
    /*  宝宝树66小区二次改造    add   luolh  20170726   start   */
    app.post('/rest/' + RESTFullServiceVersion + '/mobile/shares/shareBefore/:deviceId', share.shareBefore);
    /*  宝宝树66小区二次改造    add   luolh  20170726   end   */
    app.post('/rest/' + RESTFullServiceVersion + '/mobile/shares/addQrcodeStatistic', share.addQrcodeStatistic);

    app.post('/rest/' + RESTFullServiceVersion + '/mobile/shares/addInvitationShare', share.addInvitationShare);
    /*  宝宝树66小区三期改造    add   luolh  20170936   start   */
    // app.post('/rest/' + RESTFullServiceVersion + '/mobile/shares/addInvitationShareNew', share.addInvitationShareNew);
    //  宝宝树66小区三期改造   拦截修正 mod  luolh  20171001   start
    app.get('/app/inviteReward/index.html', share.addInvitationShareOldInit);
    app.get('/app/inviteReward/index.html/:userObjId/:inviteCode/:userId/:feedsType/:uuid/:from/', share.addInvitationShareInit);
    // 分享提交数据
    app.post('/app/inviteReward/index.html/:userObjId/:inviteCode/:userId/:feedsType/:uuid/:from/',share.addInvitationShareNew);
    app.get('/appUpload', share.addInvitationShareAppUpload);
    //  宝宝树66小区三期改造   拦截修正 mod  luolh  20171001   end
    /*  宝宝树66小区三期改造    add   luolh  20170936   start   */

    app.post('/rest/' + RESTFullServiceVersion + '/mobile/shares/getCommunityReward', share.getCommunityReward);

    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/getSharePageGoods', share.getSharePageGoods);

    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/getGoodsDetail/:goodsId', share.getGoodsDetail);

    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/getCommunityActivity/:activityId', share.getCommunityActivity);

    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/getShareRestfulByCondition/:userId', share.getShareRestfulByCondition);

    app.post('/rest/' + RESTFullServiceVersion + '/mobile/shares/getShareContentByKey/:key', share.getShareContentByKey);

    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/getTopic/:topicId', share.getTopic);
    app.get('/rest/' + RESTFullServiceVersion + '/mobile/shares/getShareByTopicId/:ts/:topicId', share.getShareByTopicId);
};